
package com.gamatechno.solodestinationnew;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;

import com.gamatechno.solodestinationnew.utils.Utils;

public class SplashActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);

        Thread timer = new Thread() {
            public void run() {
                try {
                    sleep(3000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                } finally {

                    if
                    (!TextUtils.isEmpty(Utils.getDataStringFromSP(SplashActivity.this,
                            Utils.PREF_BAHASA))) {
                        Intent i = new Intent(SplashActivity.this,
                                MainActivity.class);
                        startActivity(i);
                        finish();
                    } else {
                        Intent i = new Intent(SplashActivity.this,
                                PilihBahasaActivity.class);
                        startActivity(i);
                        finish();
                    }

                }
            }
        };
        timer.start();
    }

}
